<#--<#include "../../layout/base.ftl">-->
<#--<#macro header>-->
<style type="text/css">
    .uploadify-button {
        left: 0;
        width: 85px;
        height: 28px;
        background-repeat: no-repeat;
        border: none;
        padding: 0;
    }

    .uploadify:hover .uploadify-button {
        background-repeat: no-repeat;
        width: 85px;
        height: 28px;
    }

    .fileQueue {
        background-color: #F4F9FF;
        height: 88px;
        overflow: auto;
        width: 70%;
    }
</style>
<script type="text/javascript" src="${base}/scripts/jhgl/xycontent.js"></script>
<#--</#macro>-->
<#--<#macro body>-->
<form id="xyglForm" action="${base}/jhgl/xygl/save_xygl" method="post">
    <input type="hidden" id="xy_zgjgId" value="${(gsId)!}"/>
    <input type="hidden" id="xy_zggsId" value="${(zggsId)!}"/>
    <input type="hidden" id="xy_zgjgId" value="${(yg.zgjg.id)!}"/>
    <table style="width: 100%" class="tb tab-t">
        <input id="xy_content_id" name="xy.id" type="hidden" value="${(xy.id)!}"/>
        <col width="10%"/>
        <col width="25%"/>
        <col width="10%"/>
        <col width="15%"/>
        <col width="11%"/>
        <col width="20%"/>
        <tr>
            <th style="color:#f45212;">路&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;径：</th>
            <td colspan="3">
                <input id="xy_lj_value" type="hidden" value="${(xy.lj.id)!}"/>
                <input id='xy_lj_id' name="xy.lj.id" type="text"
                       value=""
                       class="input-text" style="width: 405px" required="true"/>
            </td>
            <th style="color:#f45212;">协议类型：</th>
            <td>
                <span id="xy_type_mc" style="font-weight: bold">
                <#if type??>
                    <#if type==1>采购协议<#elseif type==2>销售协议<#elseif type=3>三方协议</#if>
                </#if>
                </span>
                <input type="hidden" id="xy_type_id" name="type" value="${(type)!}"/>
            </td>
        </tr>
        <tr>
            <th style="color:#f45212;">所属公司：</th>
            <#--<td><input id="xy_nbgs_id" name="xy.nbgs.id" type="text"-->
                       <#--value="<#if xy??>${(xy.nbgs.id)!}<#else>${(zggsId)!}</#if>"-->
                       <#--class="input-text" required="true"/></td>-->
            <td><input id="xy_nbgs_id" name="xy.nbgs.id" type="hidden" value="<#if xy??>${(xy.nbgs.id)!}<#else>${(zggsId)!}</#if>"/>
                <span id="xy_nbgs_mc" style="font-weight: bold">${(xy.nbgs.jc)!}</span></td>
            <th style="color:#f45212;">开始时间：</th>
            <td><input name="xy.kssj" type="text" value="<#if xy??>${(xy.kssj?date)!}<#else>${(startDate?date)!}</#if>"
                       class="easyui-datebox input-text"<#-- readonly="readonly" --> <#--  data-options=" editable:false"-->
                       style="width:120px" required="true"/></td>
            <th style="color:#f45212;">结束时间：</th>
            <td><input name="xy.jssj" type="text" value="<#if xy??>${(xy.jssj?date)!}<#else>${(endDate?date)!}</#if>"
                       class="easyui-datebox input-text" <#--readonly="readonly"  -->        <#--data-options=" editable:false"-->
                       style="width:120px" required="true"/></td>
        </tr>
        <tr>
            <th id="gys_head">供&nbsp;应&nbsp;&nbsp;商：</th>
            <td id="cgxy_gys"><input id="cgxy_gys_id" name="cgxy.gys.id" type="text" value="${(cgxy.gys.id)!}"
                                     class="input-text"/></td>
            <td id="sfxy_gys" style="display: none"><input id="sfxy_gys_id" name="sfxy.gys.id" type="text"
                                                           value="${(sfxy.gys.id)!}"
                                                           class="input-text"/></td>
            <th>付款方式：</th>
            <td><input id="xy_fkfs_id" name="xy.fkfs.id" type="text" value="${(xy.fkfs.id)!}" class="input-text"
                       style="width:120px"/>
            </td>
            <th>交货方式：</th>
            <td><input name="xy.jhfs" class="input-text" type="text" maxlength="50" value="${(xy.jhfs)!}"
                       style="width:120px"/></td>
        </tr>
        <tr id="hktext" style="display: none">
            <th>客&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;户：</th>
            <td id="xsxy_kh"><input id="xsxy_kh_id" name="xsxy.kh.id" type="text" value="${(xsxy.kh.id)!}"
                                    class="input-text"/></td>
            <td id="sfxy_kh" style="display: none"><input id="sfxy_kh_id" name="sfxy.kh.id" type="text"
                                                          value="${(sfxy.kh.id)!}"
                                                          class="input-text"/></td>
            <th>计算依据：</th>
            <td id="xsxy_hkjsfs"><input id="xsxy_hkjsfs_id" name="xsxy.hkjsfs.id" type="text" style="width:120px"
                                        value="${(xsxy.hkjsfs.id)!}"
                                        class="input-text"/>
            </td>
            <td id="sfxy_hkjsfs"><input id="sfxy_hkjsfs_id" name="sfxy.hkjsfs.id" type="text" style="width:120px"
                                        value="${(sfxy.hkjsfs.id)!}"
                                        class="input-text"/>
            </td>
            <th>回款期限：</th>
            <td id="xsxy_hkqx"><input name="xsxy.hkqx" class="input-text" style="width:120px" type="text" maxlength="10"
                                      value="${(xsxy.hkqx)!}"/></td>
            <td id="sfxy_hkqx" style="display: none"><input name="sfxy.hkqx" class="input-text" style="width:120px"
                                                            maxlength="10"
                                                            type="text" value="${(sfxy.hkqx)!}"/></td>
        </tr>
        <tr id="xy_tcfs_head">
            <th>统筹方式：</th>
            <td>
                <input name="xy.jyms.tcfs.id" id = "xy_tcfs" class="input-text" type="text" value="${(xy.jyms.tcfs.id)!''}"/>
            </td>
            <th id="tcgs_color">统筹公司：</th>
            <td>
                <input id='xy_jyms_tcgs_id' name="xy.jyms.tcgs.id" type="text" value="${(xy.jyms.tcgs.id)!''}"
                       class="easyui-combotree input-text" style="width:120px"
                        />
            </td>
            <th id="tcbm_color">统筹部门：</th>
            <td>
                <input id="xy_tcbm" name="xy.jyms.tcbm.id" type="text" value="${(xy.jyms.tcbm.id)!''}" style="width:120px"
                       class="easyui-combobox input-text"
                        />
            </td>
        </tr>
        <tr>
            <th>经营品种：</th>
            <td><input name="xy.zycp" type="text" value="${(xy.zycp)!}" class="input-text" maxlength="100"/></td>
            <td colspan="4">
                <table style="width: 100%;margin-left:2px" class="tb tab-t">
                    <col width="15%"/>
                    <col width="15%"/>
                    <col width="15%"/>
                    <col width="15%"/>
                    <col width="10%"/>
                    <col width="15%"/>
                    <tr>
                        <th style="color:#f45212;">年协议量：</th>
                        <td><input id="xy_nxyl" name="xy.nxyl" class="input-text" style="width:70px"
                                   data-options="min: 0, groupSeparator: ',',precision: 4"
                                   type="text" value="${(xy.nxyl)!}" required="true"/></td>
                        <th style="color:#f45212;">月协议量：</th>
                        <td><input id="xy_yxyl" name="xy.yxyl" class="input-text" style="width:70px"
                                   data-options="min: 0, groupSeparator: ',',precision: 4"
                                   type="text" value="${(xy.yxyl)!}" required="true"/></td>
                        <th style="color:#f45212;">单位：</th>
                        <td><input name="xy.yxldw" class="input-text" style="width:35px" type="text" maxlength="5"
                                   value="<#if xy??>${(xy.yxldw)!}<#else>吨</#if>" required="true"/></td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <th>担&nbsp;保&nbsp;&nbsp;方：</th>
            <td>
                <input type="hidden" id="dbf_id" value="${(xy.dbf.id)!}"/>
                <input type="hidden" id="dbf_jc" value="${(xy.dbf.jc)!}"/>
                <input id="xy_dbf_id" name="xy.dbf.id" type="text" value="${(xy.dbf.id)!}" class="input-text"/>
            </td>
            <th>担保方式：</th>
            <td><input name="xy.dbfs" class="input-text" style="width:120px" type="text" value="${(xy.dbfs)!}"
                       maxlength="50"/></td>
            <th>担保额(万元)：</th>
            <td><input id="xy_dbe" name="xy.dbe" class="input-text" style="width:120px" type="text"
                       value="${(xy.dbe)!}"/></td>
        </tr>
        <tr id="sf_rzlx" style="display: none">
            <th>三方类型：</th>
            <td>
                <select id="xy_rzlx" class="easyui-combobox input-text" name="xy.rzlx" style="width:100px">
                    <option></option>
                    <option value="DDH" <#if (xy.rzlx)?? && xy.rzlx == 'DDH'>selected="true" </#if>>代订货</option>
                    <option value="SMY" <#if (xy.rzlx)?? && xy.rzlx == 'SMY'>selected="true" </#if>>商贸银</option>
                    <option value="BDC" <#if (xy.rzlx)?? && xy.rzlx == 'BDC'>selected="true" </#if>>保兑仓</option>
                </select>
            </td>
        </tr>
        <tr>
            <th>备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注：</th>
            <td colspan="5"><textarea name="xy.bz" rows="6" cols="37" class="textarea"
                                      style="width: 94.5%">${(xy.bz)!}</textarea></td>
        </tr>
    </table>
    <div id="fileQueue" class="fileQueue" style="float: left;margin-left:80px">
    <#if xy??>
        <#list xy.fjList as fj>
            <div id="files${fj.id}" class="uploadify-queue-item">
                <div class="cancel">
                    <a href="javascript:void(0)" onclick="deleteFile('${fj.id}','files${fj.id}')">X</a>
                </div>
                <span class="fileName">${(fj.ccmc)!}</span><span class="data"></span>
            </div>
            <input type="hidden" id="file${fj.id}" name="xy.fjList.id" value="${(fj.id)!}"/>
        </#list>
    </#if>
    </div>
    <div style="float: right;margin: 8px 34px 0 0;">
        <input type="file" name="file" id="xy-uploadify"/>
    </div>
</form>
<#--</#macro>-->
